/**
 * setInterval를 사용한 시계
 *date:2014.11
 *author:pwg
 */
var btn, div1;
var week=['일요일','월요일','화요일','수요일','목요일','금요일','토요일'];//JSON 패턴 배
열
window.onload=function(){
document.getElementById('btn').onclick=createDate;
div1 = document.getElementById('div1');
setInterval(createDate, 1000);
}
function createDate(){
var now = new Date();
var str='';
str = now.getFullYear() + '년 ';
str += (now.getMonth()+1) + '월 ';
str += now.getDate() + '일 ';
str += week[now.getDay()] + ' / ';
str += now.getHours() + '시 ';
str += now.getMinutes() + '분 ';
str += now.getSeconds() + '초 ';
div1.innerHTML = str;
}